<template>
	<view class="supervisioninformation">
		<titleName :name="name" :back-show="true"></titleName>
		<!-- <view class="title-bgc"></view> -->
			<template v-if="usertype==9">
			<view class="person-msg">
				<view class="name">
					<view class="left">姓名：</view>
					<view class="right">{{msg.username}}李国</view>
				</view>
				<view class="unit">
					<view class="left">单位：</view>
					<view class="right">{{msg.parentdepartmentname}}生态环境环保单位</view>
				</view>
				<view class="phone">
					<view class="left">手机号：</view>
					<view class="right">{{msg.mobile}}13141592655</view>
				</view>
				<view class="law-enforcement">
					<view class="left">执法证号：</view>
					<view class="right">{{msg.cardno}}314159265368979324</view>
				</view>
			</view>
		</template>
		<template v-if="usertype==1">
			<view class="line">
				<view class="left">
					<text class="star">*</text>
					<text class="text">执法人员1：</text>
				</view>
				<view class="right">{{msg.personnamefirst}}</view>
			</view>
			<view class="line">
				<view class="left">
					<text class="star">*</text>
					<text class="text">执法证号：</text>
				</view>
				<view class="right">{{msg.cardnofirst}}</view>
			</view>
			<view class="line">
				<view class="left">
					<text class="star">*</text>
					<text class="text">手机号：</text>
				</view>
				<view class="right">{{msg.mobilefirst}}</view>
			</view>
			<view class="line">
				<view class="left">
					执法人员2：
				</view>
				<view class="right">{{msg.personnamesecond}}</view>
			</view>
			<view class="line">
				<view class="left">
					执法证号：
				</view>
				<view class="right">{{msg.cardnosecond}}</view>
			</view>
			<view class="line">
				<view class="left">
					手机号：
				</view>
				<view class="right">{{msg.mobilesecond}}</view>
			</view>
		</template>
	</view>
</template>

<script setup>
	import titleName from '../../components/titleName.vue'
	import http from '../../request/index.js'
	import {
		onShow
	} from '@dcloudio/uni-app'
	import {
		ref
	} from 'vue'
	let name = ref("监管信息")
	let msg = ref({})
	let usertype = ref('')
	
	onShow(() => {
		usertype.value = uni.getStorageSync('usertype')
		// admin.value = uni.getStorageSync('admin')
		// msg.value = {
		// 	personnamefirst: '李国强',
		// 	cardnofirst: '314159265368979324',
		// 	mobilefirst: '13141592655',
		// 	personnamesecond: '李国文',
		// 	cardnosecond: '314159265368979324',
		// 	mobilesecond: '13141592655',
		// }
		// if (admin.value) {
		// 	name.value = "个人信息"
		// 	http({
		// 		url: '/user/selfinfo',

		// 	}).then((res) => {
		// 		console.log(res, 'res');
		// 		msg.value = res.data
		// 	})
		// } else {
		// 	name.value = "监管信息"
		// 	http({
		// 		url: '/enviMonitorPerson/detail'
		// 	}).then((res) => {
		// 		if (res.code == 0) {
		// 			msg.value = res.data
		// 		}
		// 	})
		// }
		http({
			url: '/enviMonitorPerson/detail'
		}).then((res) => {
			if (res.code == 0) {
				msg.value = res.data
			}
		})
	})
</script>

<style lang="scss" scoped>
	.supervisioninformation {
		width: 100vw;
		height: 100vh;
		// padding-top: 160rpx;
		overflow: hidden;

		// .title-bgc {
		// 	background: #0874FA;
		// 	height: 160rpx;
		// 	width: 100vw;
		// 	position: fixed;
		// 	top: 0;
		// 	left: 0;
		// 	z-index: 9;
		// }

		.person-msg {
			padding-top: 20rpx;

			.name,
			.unit,
			.phone,
			.law-enforcement {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-left: 32rpx;
				padding-right: 44rpx;
				height: 100rpx;
				line-height: 100rpx;

				.left {

					font-weight: 400;
					font-size: 28rpx;
					color: #000000;

				}

				.right {

					font-weight: 400;
					font-size: 28rpx;
					color: #333333;

				}
			}
		}

		.line {
			padding-top: 20rpx;
			padding-left: 32rpx;
			padding-right: 44rpx;
			display: flex;
			justify-content: space-between;
			line-height: 120rpx;

			.left {
				display: flex;
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;

				.star {
					color: #FA0808;
				}

				.text {
					color: #000000;
				}
			}

			.right {

				font-weight: 400;
				font-size: 28rpx;
				color: #333333;

			}
		}




	}
</style>